//
//  DemoHomeService.m
//  XHRouter
//
//  Created by xinph on 2020/3/16.
//  Copyright © 2020 xinph. All rights reserved.
//

#import "DemoHomeService.h"

@interface DemoHomeService ()

@property (nonatomic, assign) XHActionModuleA  targetAction;

@end

@implementation DemoHomeService

- (instancetype)initWithAction:(XHActionModuleA)action
{
    self = [super init];
    self.targetAction = action;
    return self;
}

- (NSString *)target
{
    return @"DemoHome";
}

- (NSString *)action
{
    NSString *xx = nil;
    switch (self.targetAction) {
        case XHActionModuleAXX:
            xx = @"gotoLogin";
            break;
        case XHActionModuleAYY:
            xx = @"openShop";
            break;
        default:
            break;
    }
    return xx;
}

- (NSDictionary *)commonParams
{
    NSDictionary *param = nil;
    switch (self.targetAction) {
        case XHActionModuleAXX:
            param = @{XHCommonActionParamKey: @false};
            break;
        case XHActionModuleAYY:
            param = nil;
            break;
        default:
            break;
    }
    return param;
}

- (BOOL)shouldCacheTarget
{
    return false;
}

@end
